<?php

namespace App\Listeners\Order;

class OrderRemindSubscriber
{

    /**
     * 处理事件
     *
     * @param  \App\Events\OrderShipped  $event
     * @return void
     */
    public function handle()
    {
    }

    public function subscribe($events)
    {
        $events->listen(
            'App\Events\Order\OrderRemindEvent',
            [OrderRemindSubscriber::class, 'pushSms']
        );

        $events->listen(
            'App\Events\Order\OrderRemindEvent',
            [OrderRemindSubscriber::class, 'pushMiniprogram']
        );
    }

    // 发短信
    public function pushSms($param = [])
    {

        echo '发短信' . PHP_EOL;
    }

    // 发小程序消息
    public function pushMiniprogram($param = [])
    {
        print_r($param);
        // echo '发小程序消息' . PHP_EOL;
    }
}
